import { defineConfig } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
import autoprefixer from 'autoprefixer'
import uniRouter from 'unplugin-vue-router/vite'
import UnocssIcons from '@unocss/preset-icons'

// const postcssPlugin = [autoprefixer()]

// https://vitejs.dev/config/
export default defineConfig(async () => {
    const UnoCss = await import('unocss/vite').then((i) => i.default)
    
    return {
        plugins: [uni(), uniRouter(), UnoCss()]
        // css: {
        //     postcss: {
        //         plugins: postcssPlugin
        //     }
        // }
    }
})
